package com.rxy.seckill.redis;

public class MiaoshaUserKey extends BasePrefix{
	//有效期30分钟
	public static final int TOKEN_EXPIRE = 60 * 30;
	
	private String prefix;
	
	private MiaoshaUserKey(int expireSeconds, String prefix) {
		super(expireSeconds, prefix);
		this.prefix = prefix;
	}
	public static MiaoshaUserKey token = new MiaoshaUserKey(TOKEN_EXPIRE, "tk");
	
	public static MiaoshaUserKey getById = new MiaoshaUserKey(0, "id");
	
	public MiaoshaUserKey withExpire(int seconds) {
		return new MiaoshaUserKey(seconds, prefix);
	}
}
